package tk.redbluelotto;

import java.util.HashMap;
import java.util.Map;

/**
 * Constant values used throughout the application.
 * 
 * @author <a href="mailto:matt@raibledesigns.com">Matt Raible</a>
 */
public final class Constants {

	private Constants() {
		// hide me
	}

	// ~ Static fields/initializers
	// =============================================

	/**
	 * The name of the ResourceBundle used in this application
	 */
	public static final String BUNDLE_KEY = "ApplicationResources";

	/**
	 * File separator from System properties
	 */
	public static final String FILE_SEP = System.getProperty("file.separator");

	/**
	 * User home from System properties
	 */
	public static final String USER_HOME = System.getProperty("user.home") + FILE_SEP;

	/**
	 * The name of the configuration hashmap stored in application scope.
	 */
	public static final String CONFIG = "appConfig";

	/**
	 * Session scope attribute that holds the locale set by the user. By setting
	 * this key to the same one that Struts uses, we get synchronization in
	 * Struts w/o having to do extra work or have two session-level variables.
	 */
	public static final String PREFERRED_LOCALE_KEY = "org.apache.struts2.action.LOCALE";

	/**
	 * The request scope attribute under which an editable user form is stored
	 */
	public static final String USER_KEY = "userForm";

	/**
	 * The request scope attribute that holds the user list
	 */
	public static final String USER_LIST = "userList";

	/**
	 * The request scope attribute for indicating a newly-registered user
	 */
	public static final String REGISTERED = "registered";

	/**
	 * The name of the Administrator role, as specified in web.xml
	 */
	public static final String ADMIN_ROLE = "ROLE_ADMIN";

	/**
	 * The name of the User role, as specified in web.xml
	 */
	public static final String USER_ROLE = "ROLE_USER";

	/**
	 * The name of the user's role list, a request-scoped attribute when
	 * adding/editing a user.
	 */
	public static final String USER_ROLES = "userRoles";

	/**
	 * The name of the available roles list, a request-scoped attribute when
	 * adding/editing a user.
	 */
	public static final String AVAILABLE_ROLES = "availableRoles";

	/**
	 * The name of the CSS Theme setting.
	 * 
	 * @deprecated No longer used to set themes.
	 */
	public static final String CSS_THEME = "csstheme";

	// add by timelord

	public static Map<String, Long[]> RULE = new HashMap<String, Long[]>(3);

	static {
		RULE.put("PRIME", new Long[] { 7857062932L });// 0b111010100010100010100010000010100L
		RULE.put("MOD_10", new Long[] { 8396808L,// 0b000000000100000000010000000001000L,
				4299165700L,// 0b100000000010000000001000000000100L,
				2149582850L,// 0b010000000001000000000100000000010L,
				1074791425L,// 0b001000000000100000000010000000001L,
				537395712L,// 0b000100000000010000000001000000000L,
				268697856L,// 0b000010000000001000000000100000000L,
				134348928L,// 0b000001000000000100000000010000000L,
				67174464L,// 0b000000100000000010000000001000000L,
				33587232L,// 0b000000010000000001000000000100000L,
				16793616L,// 0b000000001000000000100000000010000L
		});
		RULE.put("MOD_3", new Long[] { 1227133513L,// 0b001001001001001001001001001001001L,
				4908534052L,// 0b100100100100100100100100100100100L,
				2454267026L,// 0b010010010010010010010010010010010L
		});
		RULE.put("MOD_2", new Long[] { 2863311530L,// 0b010101010101010101010101010101010L,
				5726623061L,// 0b101010101010101010101010101010101L
		});
		RULE.put("PART_3", new Long[] { 8585740288L,// 0b111111111110000000000000000000000L,
				4192256L,// 0b000000000001111111111100000000000L,
				2047L,// 0b000000000000000000000011111111111L
		});
	}

	public static Map<String, Long[]> getRULE() {
		return RULE;
	}

}
